<?php
namespace app\admin\controller;
use think\Controller;
class Base extends Controller {
    public $account;
    public function _initialize(){
        if(!$this->isLogin()){
            $this->redirect('account/login');
        }
    }
    /**
     * 判断用户是否登陆
     * @return boolean [description]
     */
    public function isLogin(){
        $account=$this->getLoginUser();
        if($account){
            return true;
        }else{
            return false;
        }
    }
    /**
     * 得到用户的session
     */
    public function getLoginUser(){
        if(!$this->account){
            $this->account=session('account','','bis');
        }
        return $this->account;
    }
}